using System.Linq;

namespace SquaresofaSortedArray
{
    public class Solution
    {
        public int[] SortedSquares(int[] A)
        {
            var list = A.Select(a => a * a).ToList();
            list.Sort();
            return list.ToArray();
        }
    }
}